{% extends '@WebsiteBundle/layout/baselayout.html.twig' %}
{% block body_main %}
	{{ parent() }}
	<div class="page">
		{{ render(path('app_header', {"route":route})) }}
		<div class="page-wrapper">
			<div class="page-body">
				<div class="container-xl">
					<div class="row row-deck row-cards">
						<div class="col-lg-2">
							{{ render(path('app_user_userNav', {route:route})) }}
						</div>
						<div class="col-lg-10">
							<div class="card">
								<div class="card-header">
									<a href="javascript:window.history.back();" class="blue">
										<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-back-up" width="24" height="24" viewbox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
											<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
											<path d="M9 14l-4 -4l4 -4"></path>
											<path d="M5 10h11a4 4 0 1 1 0 8h-1"></path>
										</svg>
									</a>
								</div>
								<div class="card-body">
									<h3 class="h3">基本信息</h3>
									<div class="d-flex flex-row mb-3">
										<div class="p-2">订单编号:
											{{ order['orderNo'] }}</div>
										<div class="p-2 px-5">订单状态:
											{{ order['orderStatusView'] }}</div>
									</div>
									<div class="d-flex flex-row mb-3">
										<div class="p-2">下单时间：{{ date_time(order['createdAt']) }}</div>
										{% if order['couponSn'] %}
											<div class="p-2 px-5">使用优惠码：{{ order['couponSn'] }}</div>
										{% endif %}
									</div>

									{% if order['goods'] %}
										<h3 class="h3">商品信息</h3>
										{% for gv in order['goods'] %}
											<div class="d-flex flex-row mb-3">
												<div class="p-2">{{ gv['name'] }}</div>
												<div class="p-2 px-5">
													售价:
													{% if gv['shopPrice'] >0 %}
														<span class="badge bg-red">¥{{ gv['shopPrice']/100 }}</span>
													{% else %}
														<span class="badge bg-teal">免费</span>
													{% endif %}
												</div>
											</div>
										{% endfor %}
									{% endif %}


									{% if order['orderStatus'] == 2 %}
										<h3 class="h3">支付信息</h3>
										<div class="d-flex flex-row mb-3">
											<div class="p-2">支付方式：{{ order['paywayView'] }}</div>
											<div class="p-2 px-5">原价：<span class="badge bg-red">¥{{ order['originalAmount'] }}</span>
											</div>
										</div>
										<div class="d-flex flex-row mb-3">
											<div class="p-2">支付时间：{{ date_time(order['pay']['payTime']) }}</div>
											<div class="p-2 px-5">优惠金额：<span class="badge bg-red">¥{{ order['discountAmount'] }}</span>
											</div>
										</div>
										<div class="d-flex flex-row mb-3">
											<div class="p-2">实付金额：
												{% if order['orderAmount'] >0 %}
													<span class="badge bg-red">¥{{ order['orderAmount'] }}</span>
												{% else %}
													<span class="badge bg-teal">免费</span>
												{% endif %}
											</div>
										</div>
										{% if order['orderAgreementId'] %}
											<div class="d-flex flex-row mb-3">
												<div class="p-2">
													<a href="#" target="_blank">查看协议</a>
												</div>
											</div>
										{% endif %}
									{% endif %}

								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{{ render(path('app_footer')) }}
	</div>
{% endblock %}
